from PO.Base.Base import Base
from selenium.webdriver.common.by import By
from selenium import webdriver
import time
class Page(Base):
    frame_log = (By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')

    def login_frame(self):
        self.gen_frame(self.frame_log)

    name_loc = (By.NAME,'email')

    def login_nama(self,test):
        self.send_keys(self.name_loc,test)

    pwd_loc = (By.NAME, 'password')

    def login_pwd(self, test):
        self.send_keys(self.pwd_loc, test)


    login_bt = (By.ID,'dologin')

    def login_deng(self):
        self.click(self.login_bt)

    def login_go(self,name,pwd):
        self.open_url("https://mail.163.com/")
        time.sleep(2)
        self.login_frame()
        self.login_nama(name)
        self.login_pwd(pwd)
        self.login_deng()
        time.sleep(6)
        print("点击登录")


